<template>
    <view>
         <view id="success">恭喜您，支付成功</view>
         <view @tap="go">联系客服</view>
    </view>
</template>
<script>    
    export default {
        data() {
            return {
            }
        },
        onLoad() {
        },
        onShow() {        
        },
        mounted() {
            
            // #ifdef H5
            let initData = {
                action: 'onIframeReady',
                displayStyle: 'SHOW_CUSTOM_PAGE',
                height: 960
            }
            let initPostData = JSON.stringify(initData)
            parent.postMessage(initPostData, "*")
            document.getElementById("success").onclick = function () {
                var mchData = {
                    action: 'jumpOut',
                    jumpOutUrl: 'https://www.xxx.com' //跳转你想去的页面
                }
                var postData = JSON.stringify(mchData)
                parent.postMessage(postData, "*")
            }
            const link = location.href
            let sub_mch_id = this.getQueryString(link, "sub_mch_id"); //特约商户号
            let out_trade_no = this.getQueryString(link, "out_trade_no"); //商户订单号    
            console.log("以下进入你的骚操作")
            // #endif
            
        },
        
        methods: {
            
            //获取URL参数
            getQueryString(path,name){
                const reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
                if (reg.test(path)) {
                    return unescape(RegExp.$2.replace(/\+/g, " "));
                }
                return "";
            },
            
            //跳转
            go() {
                window.location.assign('https://www.xxx.com')
            },
        },
    }

</script>

